Sequence Diagram for the Hotel Management System
Create a sequence diagram for online room booking in the hotel management system and solve a challenge.
We'll cover the following
Sequence diagrams are a great way to understand the interactions between different entities and objects in the system. There can be different sequence diagrams that we can create for our hotel management system. In this lesson, we will create sequence diagrams for the following two interactions:
Book a room: The guest books a hotel room online.
Sequence challenge: The guest checks out of their room at the reception.
Book a room#
The sequence diagram for the room booking should have the following actors and objects that will interact with each other:
Actor:
Guest
Objects:
Catalog
,Booking
,Room
, andPayment
System
Here’re the steps in the book room interaction:
The guest searches for a room based on some price and style.
The catalog returns a list of rooms.
The guest selects a room they wish to book.
If the room is available:
The guest creates a booking for the room.
The booking fetches the booking price for the room.
The guest is informed that the booking is ready for payment.
The guest initiates a payment against the booking price.
The payment is processed, and the guest is informed of the status.
If the payment is successful:
The guest is informed that the payment has succeeded.
The system is informed that payment is complete.
The system updates the room status to reserved.
Else if the payment is unsuccessful:
The guest is informed that the payment has failed.
Else if the room is unavailable:
The system informs the guest that the room is unavailable.
Based on the order above, the sequence diagram of booking a room in a hotel management system is given below:
Sequence challenge: Check out#
You will help us in completing a sequence diagram for the checkout of a guest at the reception.
A skeleton of the check-out sequence diagram, given that the payment is successful, is provided below.
Notice that the arrows in the diagram above are numbered from 1 to 10. The message boxes shown below are the messages to be exchanged between the actor(s) and object(s). Can you rearrange the messages below in the correct sequence of order they should appear in the skeleton of the sequence diagram above?
Note: If you get stuck, just click the “Show Solution” button to check the correct answer.
Alternatively, you can also click the "Show complete diagram" button to view the complete sequence diagram of the check-out interaction.
In the next lesson, we’ll create activity diagrams for the hotel management system.
Class Diagram for the Hotel Management System
Activity Diagram for the Hotel Management System